package com.software.abstractFactory;

/**
 * 对象工厂生产对象
 */
public class ColorFactory extends AbstractFactory {
    @Override
    public Shape getShape(String product) {
        return null;

    }

    //equalsIgnoreCase 忽略大小写的比较字符串
    public Color getColor(String colorStr) {
        if (colorStr.equalsIgnoreCase("RED")) {
            return new Red();
        }
        if (colorStr.equalsIgnoreCase("GREEN")) {
            return new Green();
        }
        if (colorStr.equalsIgnoreCase("BLUE")) {
            return new Blue();
        }
        return null;
    }
}
